package ee.metadataUtils.impl;

import java.beans.PropertyDescriptor;
import java.lang.reflect.Field;

import ee.metadataUtils.PropertyMetadata;
import ee.metadataUtils.PropertyMetadataAdapterFactoryRegistry;
import ee.metadataUtils.PropertyMetadataFactory;

public class PropertyMetadataFactoryImpl implements PropertyMetadataFactory {

	private PropertyMetadataAdapterFactoryRegistry _adapterFactoryRegistry;

	public PropertyMetadataFactoryImpl(PropertyMetadataAdapterFactoryRegistry adapterFactoryRegistry)
	{
		_adapterFactoryRegistry = adapterFactoryRegistry;
	}
	
	@Override
	public PropertyMetadata create(Field field) {
		return new FieldPropertyMetadata(_adapterFactoryRegistry, field);
	}

	@Override
	public PropertyMetadata create(PropertyDescriptor propertyDescriptor) {
		return new PropertyDescriptorPropertyMetadata(_adapterFactoryRegistry, propertyDescriptor);
	}

	
}
